﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="sms_show.aspx.cs" Inherits="AnyOffice.general.status_bar.sms_show" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>查看短信</title>
		
		<script language="javascript" src="/aspnet_client/core/ajax.js"></script>
<SCRIPT LANGUAGE="JavaScript">
function Update_Desktop()
{
	try
	{
		if(window.opener.parent.parent.table_index.main == null)
			return;
		
		//消息类型：1公告通知,2内部邮件,7工作流,11投票提醒,12工作计划,14新闻。		
		var CODE_IDSTR = window.opener.parent.parent.table_index.main.CODE_IDSTR;
		if(CODE_IDSTR == null)		
			return;
		
		var sms_type = <%=ViewState["Type"]%>;	
		if(CODE_IDSTR.indexOf(','+sms_type+',') >= 0)
		{			
			switch(sms_type)
			{
				case 1:
					window.opener.parent.parent.table_index.main.GetNotify();
					break;
				case 2:
					window.opener.parent.parent.table_index.main.GetEmail();
					break;
				case 7:
					window.opener.parent.parent.table_index.main.GetWork();
					break;
				case 11:
					window.opener.parent.parent.table_index.main.GetVote();
					break;
				case 12:
					window.opener.parent.parent.table_index.main.GetWorkplan();
					break;
				case 14:
					window.opener.parent.parent.table_index.main.GetNews();
					break;		
			}
		}
		
	}
	catch(e)
	{
		//alert(e.message);
	}
}

function SmsIKnow()
{
	if(window.opener && !window.opener.closed)		
		parent.opener.document.getElementById("new_sms").innerHTML="";	
	location='sms_submit.aspx?sms_id=<%= ViewState["SmsId"]%>&del=0';
}

function SmsDelete()
{
	if(window.opener && !window.opener.closed)		
		parent.opener.document.getElementById("new_sms").innerHTML="";
	location='sms_submit.aspx?sms_id=<%= ViewState["SmsId"]%>&del=1';
}

function gotoURL(url,sms_id)
{		
   var xmlHttp = GetXmlHttp();
   xmlHttp.open("GET","sms_submit.aspx?sms_id=" + sms_id+ "&del=0",true);
   xmlHttp.send(null);
   if(opener.parent.parent.leftmenu)
      opener.parent.parent.leftmenu.openURL(url);
   else
   {
      mytop=(screen.availHeight-500)/2-30;
      myleft=(screen.availWidth-780)/2;
      window.open(url,"oa_sub_window","height=500,width=780,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes");
   }
   parent.opener.document.getElementById("new_sms").innerHTML="";
   window.close();
}

TimeStart=20;

function MyTimer()
{
   if(TimeStart==0)
      window.close();

   document.getElementById("TimeShow").innerHTML=TimeStart;
   TimeStart--;

   var timer=setTimeout("MyTimer()",1000);
}
</SCRIPT>
	</HEAD>
	<body class="bodycolor" topmargin="0" leftmargin="0" onload="MyTimer();">
		<form id="Form1" method="post" runat="server">
			<table class="TableBlock" width="100%" cellspacing="0" cellpadding="2" class="small">
				<tr>
					<td>
						<table border="0" cellspacing="0" width="100%" cellpadding="3" class="small">
							<tr class="TableHeader">
								<td>
									<asp:Image id="imgAvatar" runat="server" ImageAlign="AbsMiddle" EnableViewState="False"></asp:Image><B>
										<asp:Literal id="litSmsType" runat="server" EnableViewState="False"></asp:Literal></B>
								</td>
								<td class="small" align="right">
									共<span class="big4"><asp:Literal id="litNewTotalNum" runat="server"  EnableViewState="False"></asp:Literal></span>
									条新短信，本窗口<span id="TimeShow" style="FONT-WEIGHT:bold;COLOR:#ff0000"></span>&nbsp;秒后关闭
								</td>
							</tr>
						</table>
					</td>
				</tr>
				<tr class="TableData">
					<td>
						<table border="0" cellspacing="0" width="100%" cellpadding="5" class="small">
							<tr>
								<td style="COLOR:#0000ff">
									<u title="部门：<% =ViewState["DeptName"]%>" style="CURSOR:hand">
										<asp:Literal id="litFromUserName" runat="server"  EnableViewState="False"></asp:Literal></u>&nbsp;&nbsp;<asp:Literal id="litSendTime" runat="server"  EnableViewState="False"></asp:Literal>
								</td>
							</tr>
							<tr height="70" valign="top">
								<td>
									<asp:Literal id="litContent" runat="server"></asp:Literal>
								</td>
							</tr>
							<tr class="TableContent">
								<td>
									<div align="right">
										<a href="javascript:SmsIKnow();">我知道了</a>&nbsp;&nbsp;
										<asp:Literal id="litReplyButton" runat="server" EnableViewState="False"></asp:Literal>
										<asp:Literal id="litLinkButton" runat="server" EnableViewState="False"></asp:Literal>
										<a href="javascript:SmsDelete();">删除</a>&nbsp;&nbsp;
									</div>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
